package com.vancouver.knows.ui.activity.homepage.livefeed;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.pangu.ui.refresh.ARefreshViewController;
import com.vancouver.knows.R;
import com.vancouver.knows.ui.base.BaseActivity;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * Created by llf on 2016/6/13.
 */
public class HomepageLiveFeedActivity extends BaseActivity{
    private Context mContext;
    @Bind(R.id.common_tips)
    TextView mCommonTips;
    @Bind(R.id.common_back)
    ImageView mCommonBack;
    @Bind(R.id.all_speek_layout)
    LinearLayout mLinearLayout;

    private ARefreshViewController mController;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.all_speak_activity);
        mContext = HomepageLiveFeedActivity.this;
        setViews();
    }

    private void setViews() {
        Intent intent = getIntent();
        String titleStr = intent.getStringExtra("ALL_SPEAKING");

        mCommonTips.setText(titleStr);
        loadView();
    }

    private void loadView(){
        mController = new HomepageLiveFeedPullRefreshView(mContext);
        ((HomepageLiveFeedPullRefreshView) mController).loadData();
        //LiveFeedResultListView mLiveFeedView = new LiveFeedResultListView(mContext);
        mLinearLayout.addView(mController);
    }

    @OnClick(R.id.common_back)
    public void onReturnBackClick() {
       // mLinearLayout.removeAllViews();
        finish();
    }
}
